package com.atgm.mall.gmmailmember.controller;

import com.atgm.common.utils.R;
import com.atgm.mall.gmmailmember.service.MemberThumbsGameCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("gmmallmember/memberthumbsgamecomment")
public class MemberThumbsGameCommentController {

    @Autowired
    private MemberThumbsGameCommentService memberThumbsGameCommentService;

    @GetMapping("/updateCommentThumbs/{commentId}/{memberId}/{gameId}")
    public R updateCommentThumbs(@PathVariable("commentId") Long commentId, @PathVariable("memberId") Long memberId, @PathVariable("gameId") Long gameId) {
        Integer flag = memberThumbsGameCommentService.updateCommentThumbsInfo(commentId, memberId, gameId);
        return R.ok().setData(flag);
    }

    @GetMapping("/haveCommentThumbs/{memberId}/{gameId}")
    public R haveCommentThumbs(@PathVariable("memberId") Long memberId, @PathVariable("gameId") Long gameId) {
        List<Long> list = memberThumbsGameCommentService.queryIdsByMember(memberId, gameId);
        return R.ok().setData(list);
    }

}
